home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 4
/
Mac Giga-ROM 4.0 - 1993.toast
/
FILES
/
DEV
/
I-Z
/
ViewIt™ Shareware.sea
/
ViewIt™ 2.04 Shareware
/
Projects
/
Fortran Demos
/
fDemoLF.f
< prev
next >
Wrap
Text File
|
1992-08-12
|
3KB
|
127 lines
C NOTE: Read the "MPW Fortrans" section of "About Compilers"
C before compiling LF programs that use FaceWare modules.
C FaceIt 2.04 Demonstration Program
C ©FaceWare 1989-92. All Rights Reserved.
C1 - run program to see on-line comments
!!M Inlines.f
C2
!!I FaceProcLF.inc
PROGRAM fDemoLF
implicit none
C NOTE: If you use the "!!G" directive for precompiled globals, add
C our FaceStorLF.inc globals to yours and then remove following line
include 'FaceStorLF.inc'
record /FaceRec/ fRec
common/FaceStuff/fRec
integer*1 keys(16)
integer*2 i,mode
integer*4 oldCount,newCount
character*256 fileName
C3
fRec.uName = 'fDemo.Rsrc'
C4,5
call FaceIt(0,DoInit,515,0,0,0)
C6
call FaceIt(0,NewWnd,1030,1,0,0)
C7
do while (.true.)
call FaceIt(0,DoLoop,0,0,0,0)
C8
if (fRec.uMenuID = 101) then
C9
if (fRec.uMenuItem = 1) then
fRec.uString = 'Demonstration of the use of FaceIt'
+//char(13)//'to support program-wide features.'
call FaceIt(0,ShoStr,3,12,(1 + (409*65536)),0)
end if
C10
else if ((fRec.uMenuID >= 105).and.(fRec.uMenuID <= 107)) then
C11
if (fRec.uMenuItem = 1) then
call SysBeep(%val(int2(5)))
else if (fRec.uMenuItem = 2) then
call SysBeep(%val(int2(5)))
call SysBeep(%val(int2(5)))
else if (fRec.uMenuItem = 3) then
call SysBeep(%val(int2(5)))
call SysBeep(%val(int2(5)))
call SysBeep(%val(int2(5)))
C12
else if (fRec.uMenuItem = 8) then
C13
call FaceIt(0,ShoAlt,1010,0,1,1)
mode = fRec.uResult
oldCount = 0
if (mode > 1) then
do while (.true.)
C14
newCount = TickCount
if (newCount - oldCount > 180) then
call SysBeep(%val(int2(5)))
oldCount = newCount
end if
C15
if (mode = 2) then
if (GetNextEvent(%val(int2(-1)),fRec.fEvent) <> 0) then
if ((fRec.fEvent(1) = 6).or.(fRec.fEvent(1) = 15)) then
call FaceIt(0,DoEvnt,0,0,0,0)
else if (fRec.fEvent(1) = 5) then
leave
end if
end if
end if
C16
if (mode = 3) then
call GetKeys(keys)
if ((BitTst(keys,%val(61))<>0).and.(BitTst(keys,%val(48))<>0)) then
call FlushEvents(%val(int2(62)),%val(int2(0)))
leave
end if
end if
end do
end if
end if
C17
else if (fRec.uMenuID = 1030) then
if (fRec.wcHit > 3) then
call FaceIt(0,GetCtl,1030,0,1,4)
call FaceIt(0,PopMen,107,fRec.cRect(1)-5,fRec.cRect(2)-11,0)
fRec.wcHit = fRec.uMenuItem
end if
if (fRec.wcHit > 0) then
do i = 1,fRec.wcHit
call SysBeep(%val(int2(5)))
end do
end if
C18
else if (fRec.uMenuID = 1100) then
if (fRec.uMenuItem = 2) then
if (fRec.fActiveWnd = 0) then
fRec.uString = 'No Window'
else if (fRec.fActiveID <> 1200) then
fRec.uString = 'Non-ViewIt Window'
else if (fRec.fActiveResID = 1010) then
fRec.uString = 'Editor Window'
else if (fRec.fActiveResID = 1020) then
fRec.uString = 'Clipboard Window'
else if (fRec.fActiveResID = 1030) then
fRec.uString = 'Beeps Window'
end if
call FaceIt(0,SetItm2,105,10,3,0)
C19
else if (fRec.uMenuItem = 512) then
if ((fRec.uString = 'TEXT').and.(fRec.uResult = 1)) then
fileName = fRec.uName
call FaceIt(0,GetCtl,1010,0,1,1)
fRec.uName = fileName
call FaceIt(fRec.cControl,1551,0,1,0,0) !OpnCTxt
end if
end if
end if
end do
end